package com.smrtcold.dev.plc;

import com.smrtcold.dev.service.base.DefrostMode1Service;

import java.util.Arrays;
import java.util.List;

public class AATTT {

    public static void main(String[] args) {
        // 创建测试数据
        List<String> runtime = Arrays.asList("01:00-06:00", "13:00-14:00");

//        List<PointGroup> pointGroups = JSONObject.parseArray("[{\"name\":\"东冷冻库-化霜设定\",\"devid\":\"1000102\",\"extParams\":{\"maxrun\":2,\"interval\":20,\"mode\":0,\"pr_除霜运行时间\":40},\"points\":[{\"addres\":\"VW 1180,VW 1182\",\"name\":\"风机1\"},{\"addres\":\"VW 1780,VW 1782\",\"name\":\"风机2\"},{\"addres\":\"VW 1980,VW 1982\",\"name\":\"风机3\"},{\"addres\":\"VW 2180,VW 2182\",\"name\":\"风机4\"}]},{\"name\":\"西冷冻库-化霜设定\",\"devid\":\"1000102\",\"extParams\":{\"maxrun\":2,\"mode\":0,\"pr_除霜运行时间\":24,\"interval\":10},\"points\":[{\"addres\":\"VW 1380,VW 1382\",\"name\":\"风机1\"},{\"addres\":\"VW 2380,VW 2382\",\"name\":\"风机2\"},{\"addres\":\"VW 2580,VW 2582\",\"name\":\"风机3\"},{\"addres\":\"VW 2780,VW 2782\",\"name\":\"风机4\"}]}]", PointGroup.class);


// 执行调度
        DefrostMode1Service scheduler = new DefrostMode1Service();
//        List<DefrostTask> allTasks = scheduler.scheduleDefrost(runtime, pointGroups);

// 打印结果（按时间排序）
//        System.out.println("所有风机化霜任务（按时间顺序）：");
//        for (DefrostTask task : allTasks) {
//            System.out.printf("%s (%s): %02d:%02d - %02d:%02d (%d分钟)%n",
//                    task.getGroupName(),
//                    task.getFan().getName(),
//                    task.startHour, task.startMinute,
//                    task.endHour, task.endMinute,
//                    task.durationMinutes);
//        }


    }

}
